]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Be able to "switch" notifications
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 16 Aug 2012 17:39:34 +0000 (13:39 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 Aug 2012 01:15:49 +0000 (21:15 -0400)
If you click on a summary item while another is up, we should
swap without an extra click.

js/ui/messageTray.js

index f7747166046bfef83e478310d7af4aba8a4e3d00..a52702a932149a3467bf2a5c01e3f11f0ae4f965 100644 (file)
@@ -1633,10 +1633,8 @@ const MessageTray = new Lang.Class({
     _onSummaryItemClicked: function(summaryItem, button) {
         if (summaryItem.source.handleSummaryClick()) {
             this._setClickedSummaryItem(null);
-        } else if (!this._clickedSummaryItem) {
-            this._setClickedSummaryItem(summaryItem, button);
         } else {
-            this._setClickedSummaryItem(null);
+            this._setClickedSummaryItem(summaryItem, button);
         }
 
         this._updateState();
@@ -2277,9 +2275,11 @@ const MessageTray = new Lang.Class({
 
     _onSummaryBoxPointerUngrabbed: function() {
         this._summaryBoxPointerState = State.HIDING;
-        this._setClickedSummaryItem(null);
         this._unlock();
 
+        if (this._summaryBoxPointerItem == this._clickedSummaryItem)
+            this._setClickedSummaryItem(null);
+
         if (this._summaryBoxPointerItem.source.notifications.length == 0) {
             this._summaryBoxPointer.actor.hide();
             this._hideSummaryBoxPointerCompleted();